home *** CD-ROM | disk | FTP | other *** search
/ .net 62 / dotnet_62_cd1.iso / pc / Redac / Scripts / net 57 Novembre 2001 / php.txt < prev   
Encoding:
Text File  |  2001-09-24  |  1.3 KB  |  52 lines

  1. <? php
  2. $stop_message = "La date et l'heure sont dépassées";
  3. $stop_url = "http://www.yahoo.com";
  4. $stop_script = "test.php";
  5. $action = "1";
  6.     
  7. $jour = "19";
  8. $mois = "09";
  9. $annee = "2001";
  10. $secondes = "00";
  11. $minutes = "35";
  12. $heures = "09"; 
  13. function executer_action($action, $action_variable)
  14. {
  15.     if($action == "1"){
  16.         print("<h3><font face=arial>$action_variable</font></h3>");
  17.     }
  18.     elseif($action == "2"){
  19.         print("<html><head><meta http-equiv=\"Refresh\" content=\"1;URL=$action_variable\"></head><body></body></html>");
  20.     }
  21.     else{
  22.         require("$action_variable");
  23.     }
  24. }
  25. if(checkdate($mois,$jour,$annee)){
  26.     $maintenant = time();
  27.     $compte_rebours_fin = mktime($heures, $minutes, $secondes, $mois, $jour, $annee);
  28.     $reste = $compte_rebours_fin - $maintenant;
  29.     if($compte_rebours_fin <= $maintenant){
  30.         if($action == "1"){
  31.             $action_variable = $stop_message;
  32.             executer_action($action, $action_variable);
  33.         }
  34.         if($action == "2"){
  35.             $action_variable = $stop_url;
  36.             executer_action($action, $action_variable);
  37.         }
  38.         if($action == "3"){
  39.             $action_variable = $stop_script;
  40.             executer_action($action, $action_variable);
  41.         }
  42.     }
  43.     if($compte_rebours_fin > $maintenant){
  44.         print("Date STOP : ".date("j/n/Y - H:i:s",$compte_rebours_fin));
  45.     }
  46. }
  47. else{
  48.         print("<font face=arial><b>Erreur dans la date</b></font>");
  49. }
  50. ?>
  51.  
  52.